{extend name="index_layout"/}
{block name="main"}
<link href="/static/libs/formSelects-v4.css" rel="stylesheet" />
<script src="/static/libs/formSelects-v4.js"></script>
<form class="layui-form" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="bitian">*</span>账号</label>
        <div class="layui-input-block">
            <input type="text" name="username" value="{$data.username}" lay-verify="required" autocomplete="off" placeholder="用户名" disabled class="layui-input layui-disabled">
        </div>
    </div>
    <input type="hidden" value="{$data.id}" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="bitian">*</span>姓名</label>
        <div class="layui-input-block">
            <input type="text" name="nickname" value="{$data.nickname}" autocomplete="off" placeholder="真实姓名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-block">
            <input type="text" name="mobile" value="{$data.mobile}" autocomplete="off" placeholder="手机号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="password" name="password" autocomplete="off" placeholder="密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
            <input type="password" name="password_confirm" autocomplete="off" placeholder="确认密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="bitian">*</span>角色</label>
        <div class="layui-input-block">
            <select name="auth" id="" xm-select-search=""  xm-select="auth">
                {volist name="auth" id="item"}
                <option value="{$item.id}">{$item.title}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">部门</label>
        <div class="layui-input-block">
            <select name="department" id="" xm-select-search=""  xm-select="department">
                {volist name="department" id="item"}
                <option value="{$item.id}">{$item.title}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否虚拟用户</label>
        <div class="layui-input-block">
            <select name="xuni" id="" xm-select-search="" >
                <option value="0">否</option>
                <option value="1">是</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function(){
        layui.formSelects.render('auth', {
            skin: "normal", //多选皮肤normal|primary|default|danger|warm
            height: "auto",                //是否固定高度, 38px | auto
            radio: false,                  //是否设置为单选模式
            direction: "down",        //显示方式向下显示
            on: function(id, vals, val, isAdd, isDisabled){
            },            //同formSelects.on
        })
        layui.formSelects.render('department', {
            skin: "normal", //多选皮肤normal|primary|default|danger|warm
            height: "auto",                //是否固定高度, 38px | auto
            radio: false,                  //是否设置为单选模式
            direction: "down",        //显示方式向下显示
            on: function(id, vals, val, isAdd, isDisabled){
            },            //同formSelects.on
        })
        layui.formSelects.value('auth',JSON.parse('{:json_encode($authIds)}'));
        layui.formSelects.value('department',JSON.parse('{:json_encode($departmentIds)}'));
    })
    layui.use(['yznForm'], function() {
        var yznForm = layui.yznForm;
        yznForm.listen();
    });
</script>
{/block}